package cfca.seal.web.tag;

import cfca.seal.web.tag.base.TemplateDirectiveModelBase;
import freemarker.core.Environment;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Map;
import org.springframework.stereotype.Component;

@Component
public class FontFamilyTag extends TemplateDirectiveModelBase
{
  String[] font = { "宋体", "幼圆", "仿宋", "微软雅黑", "楷体", "隶书", "黑体" };

  public String process(Environment env, Map paramsMap, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException
  {
    StringBuffer sf = new StringBuffer();
    sf.append("<select size=\"1\" class=\"").append(this.className).append("\" id=\"").append(this.elementId).append("\" name = \"").append(this.elementName).append("\" onchange = \"").append(this.onChange).append("\" >");

    for (int i = 0; i < this.font.length; i++) {
      sf.append("<option value=\"").append(this.font[i]).append("\" ");
      sf.append(" >").append(this.font[i]).append("</option>");
      System.out.println();
    }
    sf.append("</select>");
    return sf.toString();
  }
}